<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>
        {% block title %}Title{% endblock %}
    </title>
    <link rel="stylesheet" href="{% static '/css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static '/css/base.css' %}">

    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"
            integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.min.js"
            integrity="sha384-VQqxDN0EQCkWoxt/0vsQvZswzTHUVOImccYmSyhJTp7kGtPed0Qcx8rK9h9YEgx+"
            crossorigin="anonymous"></script>
    <script src="{% static '/js/base.js' %}"></script>
    {% block head %}
    {% endblock %}
</head>
<body>
<header class="p-3 bg-light text-white border-bottom">
    <div class="container">
        <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
            <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
                <img src="{% static 'images/fruit.png' %}" alt="" width="32" height="32">">
            </a>

            <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
                <li><a href="{% url 'index' %}" class="nav-link px-2 text-secondary">首页</a></li>
                <li><a href="{% url 'blog:post' %}" class="nav-link px-2 text-secondary">发布博客</a></li>
            </ul>

            <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" method="get" action="{% url 'blog:search' %}">
                <input type="search" class="form-control form-control-dark" name=q placeholder="搜索..."
                       aria-label="Search">
            </form>
            {% if user.is_authenticated %}
                <div class="dropdown text-end">
                    <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" id="dropdownUser1"
                       data-bs-toggle="dropdown" aria-expanded="false">
                        <img src="https://github.com/mdo.png" alt="mdo" width="32" height="32" class="rounded-circle">
                    </a>
                    <ul class="dropdown-menu text-small" aria-labelledby="dropdownUser1">
                        <li><a class="dropdown-item" href="{% url 'auth:logout' %}">退出登录</a></li>
                        <li><a class="dropdown-item" href="{% url 'auth:reset_password' %}">重置密码</a>
                        </li>
                    </ul>
                </div>
            {% else %}
                <div class="text-end">
                    <button type="button" class="btn btn-outline-primary me-2" id="login-base-btn">登录</button>
                    <button type="button" class="btn btn-primary" id="register-base-btn">注册</button>
                </div>
            {% endif %}
        </div>
    </div>
</header>
{% block content %}
{% endblock %}
</body>
</html>